package com.ruoyi.datastatistics.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.ruoyi.common.utils.poi.ExcelHandlerAdapter;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 公摊报对象 public_share_report
 *
 * @author gdqt
 * @date 2025-05-13
 */
@TableName("t_public_share_comsume_report")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PublicShareComsumeReport extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    @TableId(value="id",type = IdType.AUTO)
    private Long id;

    /** 租户号 */
    @TableField("tenant_id")
    private String tenantId;

    /** 用户编号 */
    @TableField("user_id")
    @Excel(name = "用户编号",width = 30,sort = 3)
    private String userId;

    /** 公摊主键 */
    @TableField("public_share_id")
    private String publicShareId;

    /** 能耗分类 */
    @TableField("energy_type")
    private Long energyType;

    /** 公摊用量 */
    @TableField("public_share_cost")
    @Excel(name = "费用", width = 30, sort = 12 ,isStatistics = true)
    private BigDecimal publicShareCost;


    /** 公摊用量 */
    @TableField("public_share_amount")
    @Excel(name = "分摊用量", width = 30, sort = 11 ,isStatistics = true)
    private BigDecimal publicShareAmount;


    /** 公摊用量 */
    @TableField("price")
    @Excel(name = "单价", width = 30, sort = 10)
    private BigDecimal price;




    // /** 公摊费用 */
    // @TableField("public_share_cost")
    // private BigDecimal publicShareCost;
    //
    // @TableField("price")
    // private BigDecimal price;

    /** 报表日期 */
    @TableField("report_date")
    @Excel(name = "日期",width = 30,sort = 5)
    private String reportDate;

    /** 报表类型 */
    @TableField("report_type")
    private Long reportType;

    /** 创建人 */
    @TableField("created_by")
    private String createdBy;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("created_time")
    private Date createdTime;

    /** 更新人 */
    @TableField("updated_by")
    private String updatedBy;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("updated_time")
    private Date updatedTime;

    @TableField("public_share_coefficient")
    // @Excel(name = "占比（%）", width = 40, sort = 9  ,decimalFormat = 11)
    @Excel(name = "占比", width = 40, sort = 9 )
    private BigDecimal publicShareCoefficient;





    @TableField(exist = false)
    @Excel(name = "用户名称",width = 30,sort = 4)
    private String userName;

    @TableField(exist = false)
    @Excel(name = "所属区域",width = 30,sort = 1)
    private String areaName;

    @TableField(exist = false)
    @Excel(name = "公摊名称",width = 30,sort = 2)
    private String publicShareName;

    @TableField(exist = false)
    private String areaId;

    @TableField("location_nb")
    private String locationNb;

    @TableField("terminal_id")
    private String terminalId;

    @TableField(exist = false)
    private BigDecimal totalAmount;

    @TableField(exist = false)
    private String sheetsCode;

    /** 公摊用量 */
    @Excel(name = "公摊生产和",width = 30,sort = 6)
    @TableField("public_share_total_amount")
    private BigDecimal publicShareTotalAmount;

    /** 公摊用量 */
    @Excel(name = "公摊消费和",width = 30,sort = 7)
    @TableField("public_share_alluser_amount")
    private BigDecimal publicShareAlluserAmount;

    /** 公摊用量 */
    @Excel(name = "该用户用量",width = 30,sort = 8)
    @TableField("public_share_oneuser_amount")
    private BigDecimal publicShareOneuserAmount;



    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("tenantId", getTenantId())
            .append("userId", getUserId())
            .append("publicShareId", getPublicShareId())
            .append("energyType", getEnergyType())
            .append("publicShareAmount", getPublicShareAmount())
            .append("publicShareCost", getPublicShareCost())
            .append("reportDate", getReportDate())
            .append("reportType", getReportType())
            .append("createdBy", getCreatedBy())
            .append("createdTime", getCreatedTime())
            .append("updatedBy", getUpdatedBy())
            .append("updatedTime", getUpdatedTime())
            .toString();
    }
}
